import request from '@/utils/request'

export function sendMessage(data) {
  return request({
    url: `/api/example/message/send`,
    method: 'POST',
    data
  })
}

export function markMessagesAsRead(data) {
  return request({
    url: `/api/example/message/mark-read`,
    method: 'PUT',
    data
  })
}

export function queryMessages(data) {
  return request({
    url: `/api/example/message/query`,
    method: 'POST',
    data
  })
}

export function getUnreadMessages (id) {
  return request({
    url: `/api/example/message/unread/${id}`,
    method: 'GET',
  })
}

export function groupsPersons () {
  return request({
    url: `/api/groups/groups-persons`,
    method: 'GET',
  })
}

export function PersonsGroupNames () {
  return request({
    url: `/api/groups/person-groups`,
    method: 'GET',
  })
}

